import 'package:flutter/material.dart';
import 'package:movie_ui_app/components/genre_card.dart';
import 'package:movie_ui_app/constans.dart';
import 'package:movie_ui_app/models/movie.dart';

class Genres extends StatelessWidget {
  final Movie movie;
  const Genres({Key key, this.movie}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.symmetric(vertical: kDefaultPadding / 2),
      child: SizedBox(
          height: 36,
          child: ListView.builder(
            scrollDirection: Axis.horizontal,
            itemCount: movie.genra.length,
            itemBuilder: (BuildContext context, int index) {
              return GenreCard(genre: movie.genra[index]);
            },
          )),
    );
  }
}
